﻿using System.Collections;
using System.Collections.Generic;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
using UnityEngine;

public class PrefabDoc : DocPrimitive
{
    [YamlMember(Alias = "Prefab", ApplyNamingConventions = false)]
    public PrefabObj pl { get; set; }
}

public class PrefabObj
{
    [YamlMember(Alias = "m_ObjectHideFlags", ApplyNamingConventions = false)]
    public int hideFlags { get; set; }

    [YamlMember(Alias = "serializedVersion", ApplyNamingConventions = false)]
    public int serializedVersion { get; set; }

    [YamlMember(Alias = "m_Modification", ApplyNamingConventions = false)]
    public PrefabModification modification { get; set; }

    [YamlMember(Alias = "m_ParentPrefab", ApplyNamingConventions = false)]
    public Dictionary<string, string> parentPrefab { get; set; }

    [YamlMember(Alias = "m_IsPrefabParent", ApplyNamingConventions = false)]
    public int isPrafabParent { get; set; }
}

public class PrefabModification
{
    [YamlMember(Alias = "m_TransformParent", ApplyNamingConventions = false)]
    public Dictionary<string, string> transformParent { get; set; }

    [YamlMember(Alias = "m_Modifications", ApplyNamingConventions = false)]
    public List<ModificationMod> modifications { get; set; }

    [YamlMember(Alias = "m_RemovedComponents", ApplyNamingConventions = false)]
    public List<RemovedComponent> removedComponent { get; set; }
}

public class ModificationMod
{
    [YamlMember(Alias = "target", ApplyNamingConventions = false)]
    public Dictionary<string, string> target { get; set; }

    [YamlMember(Alias = "propertyPath", ApplyNamingConventions = false)]
    public string propertyPath { get; set; }

    [YamlMember(Alias = "value", ApplyNamingConventions = false)]
    public string value { get; set; }

    [YamlMember(Alias = "objectReference", ApplyNamingConventions = false)]
    public Dictionary<string, string> objectRef { get; set; }
}

public class RemovedComponent
{
    [YamlMember(Alias = "Component", ApplyNamingConventions = false)]
    public Dictionary<string, string> component { get; set; }
}